// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file ObjectCan.cpp
 * This source file contains the implementation of the described types in the IDL file.
 *
 * This file was generated by the tool fastddsgen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace {
char dummy;
}  // namespace
#endif  // _WIN32

#include "ObjectCan.h"

#include <fastcdr/Cdr.h>


#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>


namespace vis_msg {



ObjectCan::ObjectCan()
    : Header()

{
}

ObjectCan::~ObjectCan()
{
}

ObjectCan::ObjectCan(
        const ObjectCan& x)
    : Header(x)

{
    m_objects = x.m_objects;
    m_alarmInfo = x.m_alarmInfo;
    m_faultInfo = x.m_faultInfo;
    m_restrictAreaLenght = x.m_restrictAreaLenght;
    m_mRestrictAreaIsValid = x.m_mRestrictAreaIsValid;
    m_mSelfTestStatus = x.m_mSelfTestStatus;
    m_moduleTemperature = x.m_moduleTemperature;
}

ObjectCan::ObjectCan(
        ObjectCan&& x) noexcept
    : Header(std::move(x))

{
    m_objects = std::move(x.m_objects);
    m_alarmInfo = std::move(x.m_alarmInfo);
    m_faultInfo = std::move(x.m_faultInfo);
    m_restrictAreaLenght = x.m_restrictAreaLenght;
    m_mRestrictAreaIsValid = x.m_mRestrictAreaIsValid;
    m_mSelfTestStatus = x.m_mSelfTestStatus;
    m_moduleTemperature = x.m_moduleTemperature;
}

ObjectCan& ObjectCan::operator =(
        const ObjectCan& x)
{
    Header::operator =(x);

    m_objects = x.m_objects;
    m_alarmInfo = x.m_alarmInfo;
    m_faultInfo = x.m_faultInfo;
    m_restrictAreaLenght = x.m_restrictAreaLenght;
    m_mRestrictAreaIsValid = x.m_mRestrictAreaIsValid;
    m_mSelfTestStatus = x.m_mSelfTestStatus;
    m_moduleTemperature = x.m_moduleTemperature;
    return *this;
}

ObjectCan& ObjectCan::operator =(
        ObjectCan&& x) noexcept
{
    Header::operator =(std::move(x));

    m_objects = std::move(x.m_objects);
    m_alarmInfo = std::move(x.m_alarmInfo);
    m_faultInfo = std::move(x.m_faultInfo);
    m_restrictAreaLenght = x.m_restrictAreaLenght;
    m_mRestrictAreaIsValid = x.m_mRestrictAreaIsValid;
    m_mSelfTestStatus = x.m_mSelfTestStatus;
    m_moduleTemperature = x.m_moduleTemperature;
    return *this;
}

bool ObjectCan::operator ==(
        const ObjectCan& x) const
{
    if (Header::operator !=(x))
        {
            return false;
        }
    return (m_objects == x.m_objects &&
           m_alarmInfo == x.m_alarmInfo &&
           m_faultInfo == x.m_faultInfo &&
           m_restrictAreaLenght == x.m_restrictAreaLenght &&
           m_mRestrictAreaIsValid == x.m_mRestrictAreaIsValid &&
           m_mSelfTestStatus == x.m_mSelfTestStatus &&
           m_moduleTemperature == x.m_moduleTemperature);
}

bool ObjectCan::operator !=(
        const ObjectCan& x) const
{
    return !(*this == x);
}

/*!
 * @brief This function copies the value in member objects
 * @param _objects New value to be copied in member objects
 */
void ObjectCan::objects(
        const std::vector<Object_t>& _objects)
{
    m_objects = _objects;
}

/*!
 * @brief This function moves the value in member objects
 * @param _objects New value to be moved in member objects
 */
void ObjectCan::objects(
        std::vector<Object_t>&& _objects)
{
    m_objects = std::move(_objects);
}

/*!
 * @brief This function returns a constant reference to member objects
 * @return Constant reference to member objects
 */
const std::vector<Object_t>& ObjectCan::objects() const
{
    return m_objects;
}

/*!
 * @brief This function returns a reference to member objects
 * @return Reference to member objects
 */
std::vector<Object_t>& ObjectCan::objects()
{
    return m_objects;
}


/*!
 * @brief This function copies the value in member alarmInfo
 * @param _alarmInfo New value to be copied in member alarmInfo
 */
void ObjectCan::alarmInfo(
        const AlarmInfo_t& _alarmInfo)
{
    m_alarmInfo = _alarmInfo;
}

/*!
 * @brief This function moves the value in member alarmInfo
 * @param _alarmInfo New value to be moved in member alarmInfo
 */
void ObjectCan::alarmInfo(
        AlarmInfo_t&& _alarmInfo)
{
    m_alarmInfo = std::move(_alarmInfo);
}

/*!
 * @brief This function returns a constant reference to member alarmInfo
 * @return Constant reference to member alarmInfo
 */
const AlarmInfo_t& ObjectCan::alarmInfo() const
{
    return m_alarmInfo;
}

/*!
 * @brief This function returns a reference to member alarmInfo
 * @return Reference to member alarmInfo
 */
AlarmInfo_t& ObjectCan::alarmInfo()
{
    return m_alarmInfo;
}


/*!
 * @brief This function copies the value in member faultInfo
 * @param _faultInfo New value to be copied in member faultInfo
 */
void ObjectCan::faultInfo(
        const FaultInfo_t& _faultInfo)
{
    m_faultInfo = _faultInfo;
}

/*!
 * @brief This function moves the value in member faultInfo
 * @param _faultInfo New value to be moved in member faultInfo
 */
void ObjectCan::faultInfo(
        FaultInfo_t&& _faultInfo)
{
    m_faultInfo = std::move(_faultInfo);
}

/*!
 * @brief This function returns a constant reference to member faultInfo
 * @return Constant reference to member faultInfo
 */
const FaultInfo_t& ObjectCan::faultInfo() const
{
    return m_faultInfo;
}

/*!
 * @brief This function returns a reference to member faultInfo
 * @return Reference to member faultInfo
 */
FaultInfo_t& ObjectCan::faultInfo()
{
    return m_faultInfo;
}


/*!
 * @brief This function sets a value in member restrictAreaLenght
 * @param _restrictAreaLenght New value for member restrictAreaLenght
 */
void ObjectCan::restrictAreaLenght(
        int32_t _restrictAreaLenght)
{
    m_restrictAreaLenght = _restrictAreaLenght;
}

/*!
 * @brief This function returns the value of member restrictAreaLenght
 * @return Value of member restrictAreaLenght
 */
int32_t ObjectCan::restrictAreaLenght() const
{
    return m_restrictAreaLenght;
}

/*!
 * @brief This function returns a reference to member restrictAreaLenght
 * @return Reference to member restrictAreaLenght
 */
int32_t& ObjectCan::restrictAreaLenght()
{
    return m_restrictAreaLenght;
}


/*!
 * @brief This function sets a value in member mRestrictAreaIsValid
 * @param _mRestrictAreaIsValid New value for member mRestrictAreaIsValid
 */
void ObjectCan::mRestrictAreaIsValid(
        bool _mRestrictAreaIsValid)
{
    m_mRestrictAreaIsValid = _mRestrictAreaIsValid;
}

/*!
 * @brief This function returns the value of member mRestrictAreaIsValid
 * @return Value of member mRestrictAreaIsValid
 */
bool ObjectCan::mRestrictAreaIsValid() const
{
    return m_mRestrictAreaIsValid;
}

/*!
 * @brief This function returns a reference to member mRestrictAreaIsValid
 * @return Reference to member mRestrictAreaIsValid
 */
bool& ObjectCan::mRestrictAreaIsValid()
{
    return m_mRestrictAreaIsValid;
}


/*!
 * @brief This function sets a value in member mSelfTestStatus
 * @param _mSelfTestStatus New value for member mSelfTestStatus
 */
void ObjectCan::mSelfTestStatus(
        bool _mSelfTestStatus)
{
    m_mSelfTestStatus = _mSelfTestStatus;
}

/*!
 * @brief This function returns the value of member mSelfTestStatus
 * @return Value of member mSelfTestStatus
 */
bool ObjectCan::mSelfTestStatus() const
{
    return m_mSelfTestStatus;
}

/*!
 * @brief This function returns a reference to member mSelfTestStatus
 * @return Reference to member mSelfTestStatus
 */
bool& ObjectCan::mSelfTestStatus()
{
    return m_mSelfTestStatus;
}


/*!
 * @brief This function sets a value in member moduleTemperature
 * @param _moduleTemperature New value for member moduleTemperature
 */
void ObjectCan::moduleTemperature(
        uint8_t _moduleTemperature)
{
    m_moduleTemperature = _moduleTemperature;
}

/*!
 * @brief This function returns the value of member moduleTemperature
 * @return Value of member moduleTemperature
 */
uint8_t ObjectCan::moduleTemperature() const
{
    return m_moduleTemperature;
}

/*!
 * @brief This function returns a reference to member moduleTemperature
 * @return Reference to member moduleTemperature
 */
uint8_t& ObjectCan::moduleTemperature()
{
    return m_moduleTemperature;
}




} // namespace vis_msg
// Include auxiliary functions like for serializing/deserializing.
#include "ObjectCanCdrAux.ipp"

